<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVCarSchemesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('v_car_schemes', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('model_site_id')->default(0)->comment('车型配置ID');
            $table->integer('box_site_id')->default(0)->comment('车箱配置ID');
            $table->integer('length_site_id')->default(0)->comment('车长配置ID');
            $table->timestamps();
            $table->index('model_key', 'idx_model_key');
            $table->index('box_key', 'idx_box_key');
            $table->index('length_key', 'idx_length_key');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('v_car_schemes');
    }
}
